solve equations with the distributive property